﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Recommend.API.Data;
using Microsoft.EntityFrameworkCore;

namespace Recommend.API.Controllers
{
    [Route("api/[controller]/[action]")]
    public class RecommendsController : BaseController
    {
        private readonly ProjectRecommendContext _context;
        public RecommendsController(ProjectRecommendContext context)
        {
            _context = context;
        }
        public async Task<IActionResult> Get()
        { var list= await _context.ProjectRecommend
                .AsNoTracking()
                .Where(p=>p.FromUserId==UserIdentity.Id)
                .ToListAsync();
            return Json(list);
        }
    }
}
